Skip to content

Conversation

@filipopo
Copy link
Contributor

@filipopo filipopo commented Aug 10, 2025

These are some changes that reduce the image size and make the build faster

dnf:
--nodocs doesn't install documentation files, can be be checked with e.g rpm -qd unzip

Using install_weak_deps=0 installs about 110 less packages, can be checked with dnf install

clean all will remove package install cache, I also added in a rm -rf for the "best practices"

pip:
--no-cache-dir kinda self-explanatory

-U will upgrade the package if there's a new release

Overall the difference in the image size is 2.58GB without, versus 2.06GB with the new flags

I also corrected this => WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)

Of course I ran a basic test to make sure that it still works

curl 'http://localhost:9000/2015-03-31/functions/function/invocations' -d '{}'
"Example Domain\nThis domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.\nMore information..."

@umihico
Copy link
Owner

umihico commented Aug 11, 2025

Hi @filipopo,

Thank you for the optimization work - reducing the image from 2.58GB to 2.06GB is impressive!

Unfortunately, I need to close this PR because:

  1. It has merge conflicts
  2. This repository prioritizes simplicity for beginners over performance optimizations

As a proof-of-concept repository, I want to keep the Dockerfile minimal and immediately understandable for first-time users, even if it means larger image sizes. The optimization flags (--nodocs, --setopt=install_weak_deps=0, etc.) add complexity that might confuse newcomers.

Your PR is still valuable as it documents these optimizations for anyone who needs production-level performance!

Thanks for all your contributions to the project! 🙏

@umihico umihico closed this Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants